The present invention relates to database management systems, and more particularly, to the transforming of documents to and from data objects in the database management systems.
The use of database management systems to manage information is well known in the art. For complex data management, object-oriented approaches are generally used. The term xe2x80x9cobject-orientedxe2x80x9d refers to a software design method which uses xe2x80x9cclassesxe2x80x9d and xe2x80x9cobjectsxe2x80x9d to model abstract or real objects. An xe2x80x9cobjectxe2x80x9d is the main building block of object-oriented programming, and is a programming unit which has both data and functionality (i.e., xe2x80x9cmethodsxe2x80x9d). A xe2x80x9cclassxe2x80x9d defines the implementation of a particular kind of object, the variables and methods it uses, and the parent class it belongs to. Some known programming tools that can be used for developing search and result-management frameworks include C++ and Java.
FIG. 1 illustrates a content management object oriented framework, the Enterprise Information Portal (EIP). The EIP 100 comprises a plurality of class libraries 102, including a dynamic data object (DDO) class 104. The DDO is a database-neutral representation of an object""s persistent data. Its purpose is to contain the data for a single object. The DDO comprises a set of attributes and is a self-describing data object. Some of the DDO attributes could be of the extended data object (XDO) type. The XDO is used to hold content which is usually a large object (LOB). The DDO class has methods to support persistent operation on its data content, i.e., add, delete, update, and retrieve the data. These methods are used to bring data objects in and out of the persistent store. In these operations, the content or LOB will also be made persistent as well. The DDO specification is further described in the industry standard as established by the Object Management Group (OMG).
The EIP 100 also comprises datastores 107. A datastore is a term used to refer to a generic data storage facility, such as a relational data base, flat-file, hierarchical data base, etc. For example, for the CONTENT MANAGER, developed by INTERNATIONAL BUSINESS MACHINES CORPORATION, the EIP datastores 106 comprises a content manager datastore 108. The content manager datastore 108 would store the different types of data managed by the Content Manager.
However, the EIP 100 is not able to import documents with the extensible markup language (XML) format into its framework as data objects. The use of the XML document format has received widespread adoption by the industry. This approach provides numerous advantages, such as interchanging electronic documents between document repositories, automating business-to-business and business-to-consumer transactions, and allowing application programs to communicate regardless of programming languages and computing platforms where the applications run. Because the EIP 100 cannot import XML documents as data objects, it cannot exploit these advantages.
Accordingly, there exists a need for a method and system for transforming XML documents to and from data objects in an object oriented framework. The present invention addresses such a need.
A method and system for transforming XML documents to and from data objects in an object oriented framework includes: importing the XML document; parsing the XML document; building a DOM tree from the parsed XML document; constructing at least one DDO or at least one XDO based on the DOM tree; and storing the DDO or XDO in a datastore. The present invention provides a transformation bridge connecting the XML world and the object world, allowing conversions from XML documents to data objects and vice versa to be performed seamlessly. It enhances the existing framework with a feature to process XML documents utilizing the existing framework facilities. Application developers can thus exploit the key advantages of XML representation as well as object orientation.